package com.bright.hxj.cwduijie.constant;

import com.bright.ghj.common.util.StringUtil;
import com.bright.hxj.cwduijie.util.EntityManagerUtil;
import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author hxj
 * @Date 2024/12/5 20:29
 * @Description 数据库类型常量
 */

@Component
@Data
public class DBTypeConstants implements InitializingBean {

    @Value("${database.type:sqlserver}")
    public String dataBaseType;

    @Override
    public void afterPropertiesSet() {
//        System.out.println("afterPropertiesSet被调用，dataBaseType=" + dataBaseType);

        if (StringUtil.equalsIgnoreCase(dataBaseType, "dm")) {
            EntityManagerUtil.IS_DM = true;
        }
    }
}
